#! /bin/sh

name=harfbuzz
version=11.2.0
revision=1
tarball_url="https://github.com/harfbuzz/harfbuzz/releases/download/${version}/harfbuzz-${version}.tar.xz"
tarball_blake2b="112693a42120407c25b8bf84ed14f7a481810f34557132e5902e5eeaa967071d0aa785961541b7779b7d36f353c54b6f3167c3ab6bdb81238a69d385dab3ebfe"
imagedeps="meson ninja-build"
hostdeps="gcc pkg-config"
deps="core-libs graphite2 glib zlib freetype2 cairo icu"

configure() {
    cp -rp "${source_dir}"/. ./

    mkdir build && cd build

        meson_source_dir=.. \
    meson_configure \
        -Dcpp_std=c++17 \
        -Dgraphite2=enabled \
        -Dglib=enabled \
        -Dgobject=disabled \
        -Dicu=enabled \
        -Dfreetype=enabled \
        -Dcairo=enabled \
        -Dintrospection=disabled \
        -Dtests=disabled

    cd ..
}

build() {
    ( cd build && ninja -j${parallelism} )
}

package() {
    ( cd build && DESTDIR="${dest_dir}" ninja install )

    post_package_strip
}
